﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

using nPress.Core.Interfaces;
using FluentNHibernate.Mapping;
using FluentNHibernate.Cfg;
using FluentNHibernate.AutoMap;

namespace nPress.Core.Mapping
{
    public class MapBase<T> : ClassMap<T> where T : IIdentifiable
    {
        public MapBase(string tableBaseName)
        {
            TableBaseName = tableBaseName;
            WithTable(TablePrefix + TableBaseName);
         }

        public string TablePrefix
        {
            get { return ConfigurationManager.AppSettings["TablePrefix"]; }
        }

        public string TableBaseName { get; private set; }
    }
}
